<template>
  <div class="bucket-mgr">
    <div class="bucket-mgr__item" v-for="item in list" @click="goDetail(item)">
      <div class="bucket-mgr__item__num">订单号：{{item.id}}</div>
      <div class="bucket-mgr__item__row">
        <div class="bucket-mgr__item__row__el bucket-mgr__item__row__el_tit">下单时间：</div>
        <div class="bucket-mgr__item__row__el bucket-mgr__item__row__el_info">{{item.time}}</div>
      </div>
    </div>
  </div>
</template>

<script>
  import {
    MONEY_PAY_LIST
  } from '@/api/user';
  import {
    mapState
  } from 'vuex'
  export default {
    computed: {
      ...mapState(['stationInfo'])
    },
    data() {
      return {
        list: []
      }
    },
    mounted() {
      this.getList();
    },
    methods: {
      goDetail(item) {
        this.$router.push({
          path: 'waterMoneyManagementDetail',
          query: {
            item: item,
            type: 'pay'
          }
        })
      },
      getList() {
        this.$reqPost(MONEY_PAY_LIST, {
          stationId: this.stationInfo.id
        }).then(res => {
          this.list = res.rows;
          if(this.list.length == 0){
            this.$toast('暂无数据')
          }
        });
      }
    }
  }

</script>
